import Vue from 'vue'
import Router from 'vue-router'
import base from "./modules/base";
import user from "./modules/user";
import config from "./modules/config";

Vue.use(Router);

export default new Router({
    // mode: 'history',
    // base: process.env.BASE_URL,
    routes: [
        {
            path: '/login',
            name: 'login',
            component: () => import('../view/main/login')
        },
        {
            path: '/',
            name: 'main',
            component: () => import('../view/main/main'),
            redirect: '/index',
            children: [
                ...base,
                ...user,
                ...config,
            ]
        },
        {
            path: '/403',
            name: '403',
            meta: {title: '没有权限'},
            component: () => import('../view/main/403.vue')
        },
        {
            path: '*',
            name: '404',
            meta: {title: '页面不存在'},
            component: () => import('../view/main/404.vue')
        }
    ]
})
